package org.benjamin.lending.domain;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;

/**
 * Created by xywen on 2017/6/2.
 */
public class BasicIndex {

    private Integer pageSize = 30;

    private Integer pageCurrent = 1;

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageCurrent() {
        return pageCurrent;
    }

    public void setPageCurrent(Integer pageCurrent) {
        this.pageCurrent = pageCurrent;
    }

    public PageRequest getPageRequest(){
        PageRequest pageRequest = new PageRequest(pageCurrent-1,pageSize,new Sort(Sort.Direction.DESC,"id"));
        return pageRequest;
    }
}
